<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSystemRolePermissions extends \App\Utils\CreateMigration
{
    function columns(Blueprint $table)
    {
        $table->unsignedBigInteger('role_id')->default(0)->comment('角色ID');
        $table->string('permission_code')->default('')->comment('权限编码');
        $table->unique(['permission_code', 'role_id', 'deleted_at'], 'uk_role_permission');
    }

    function tableInfo()
    {
        return ['system__role_permissions', '系统-角色权限'];
    }
}
